var mongoose=require('mongoose');
var opts={
  server:{
    socketOptions:{keepAlive:1}
  }
};

switch (app.get('env')) {
  case 'development':
    mongoose.connect('mongodb://dev:111111@ds011291.mlab.com:11291/meadownlark',opts);
    break;
  case 'production':
    mongoose.connect('mongodb://dev:111111@ds011291.mlab.com:11291/meadownlark',opts);

}

var attractionSchema=mongoose.Schema({
  name:String,
  description:String,
  location:{lat:Number,lng:Number},
  history:{
    event:String,
    notes:String,
    email:String,
    date:Date,
  },
  updateId:String,
  approved:Boolean,
});

var Attraction=mongoose.model('Attraction',attractionSchema);
module.exports=Attraction;
